\doxysection{Mag\+Graphics\+View Class Reference}
\hypertarget{class_mag_graphics_view}{}\label{class_mag_graphics_view}\index{MagGraphicsView@{MagGraphicsView}}


图形视图类  




{\ttfamily \#include $<$Mag\+Graphics\+View.\+h$>$}

Inheritance diagram for Mag\+Graphics\+View\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_mag_graphics_view}
\end{center}
\end{figure}
\doxysubsubsection*{Public Slots}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{class_mag_graphics_view_a9efcab8c2747320e9c469cc77acdf11a}{show\+Mesh}} (const \mbox{\hyperlink{class_g_mesh}{GMesh}} \&mesh)
\begin{DoxyCompactList}\small\item\em 显示网格 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_mag_graphics_view_a06c0fbf0bb356cb2fdaa7e1af0e6b025}{resize\+Graphics}} (\mbox{\hyperlink{class_mag_graphics_view}{Mag\+Graphics\+View}} \texorpdfstring{$\ast$}{*}Show\+Graphics)
\begin{DoxyCompactList}\small\item\em 将显示的图形缩放到合适大小 \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_mag_graphics_view_a9175a33e8e2739d3e5e632c6c2715da7}{Mag\+Graphics\+View}} (QWidget \texorpdfstring{$\ast$}{*}parent=nullptr)
\begin{DoxyCompactList}\small\item\em 构造函数 \end{DoxyCompactList}\item 
\Hypertarget{class_mag_graphics_view_a026b98b72cf9edb611cc998d529587d8}\label{class_mag_graphics_view_a026b98b72cf9edb611cc998d529587d8} 
{\bfseries \texorpdfstring{$\sim$}{\string~}\+Mag\+Graphics\+View} ()
\begin{DoxyCompactList}\small\item\em 析构函数 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_mag_graphics_view_a3d0f9f9a0d29d1fe8ec9645b38f9721d}{add\+Point}} (QList$<$ QPointF $>$ Points)
\begin{DoxyCompactList}\small\item\em 向场景中添加点 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_mag_graphics_view_aff7c12efbb55fcda4f29e932ff891ce0}{add\+Line}} (QList$<$ QPointF $>$ Points)
\begin{DoxyCompactList}\small\item\em 向场景中添加线 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_mag_graphics_view_aa565f78d8f8e2897335665b2536032f6}{add\+Rriangle}} (QList$<$ QPointF $>$ Points)
\begin{DoxyCompactList}\small\item\em 向场景中添加三角形 \end{DoxyCompactList}\item 
\Hypertarget{class_mag_graphics_view_a79d8615756b7c80bd17ce15f68babe67}\label{class_mag_graphics_view_a79d8615756b7c80bd17ce15f68babe67} 
void {\bfseries clear\+Canvas} ()
\begin{DoxyCompactList}\small\item\em 清空场景 \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{class_mag_graphics_view_a5522102a95e0a3b8d08bc9dccce5063e}{wheel\+Event}} (QWheel\+Event \texorpdfstring{$\ast$}{*}event) override
\begin{DoxyCompactList}\small\item\em 重写鼠标滚轮事件处理函数 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_mag_graphics_view_a880c0681111672605333b1c15b567b1c}{mouse\+Press\+Event}} (QMouse\+Event \texorpdfstring{$\ast$}{*}event) override
\begin{DoxyCompactList}\small\item\em 重写鼠标按下事件处理函数 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_mag_graphics_view_a795ba880577b0ed3d11266f75734c73c}{mouse\+Move\+Event}} (QMouse\+Event \texorpdfstring{$\ast$}{*}event) override
\begin{DoxyCompactList}\small\item\em 重写鼠标移动事件处理函数 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_mag_graphics_view_a583b7e56e1f37c7f372a0b47a0b21ef0}{mouse\+Release\+Event}} (QMouse\+Event \texorpdfstring{$\ast$}{*}event) override
\begin{DoxyCompactList}\small\item\em 重写鼠标释放事件处理函数 \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_mag_graphics_view_aa8eb070a34aba2fc4de03130557f46be}{event\+Filter}} (QObject \texorpdfstring{$\ast$}{*}obj, QEvent \texorpdfstring{$\ast$}{*}event) override
\begin{DoxyCompactList}\small\item\em 重写事件过滤器函数 \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
图形视图类 

继承自\+QGraphics\+View类，实现了鼠标滚轮事件、鼠标按下、移动、释放事件的处理函数，以及鼠标坐标标签的显示。 

\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{class_mag_graphics_view_a9175a33e8e2739d3e5e632c6c2715da7}\label{class_mag_graphics_view_a9175a33e8e2739d3e5e632c6c2715da7} 
\index{MagGraphicsView@{MagGraphicsView}!MagGraphicsView@{MagGraphicsView}}
\index{MagGraphicsView@{MagGraphicsView}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{MagGraphicsView()}{MagGraphicsView()}}
{\footnotesize\ttfamily Mag\+Graphics\+View\+::\+Mag\+Graphics\+View (\begin{DoxyParamCaption}\item[{QWidget \texorpdfstring{$\ast$}{*}}]{parent = {\ttfamily nullptr} }\end{DoxyParamCaption})}



构造函数 


\begin{DoxyParams}{Parameters}
{\em parent} & 父对象 \\
\hline
\end{DoxyParams}


\doxysubsection{Member Function Documentation}
\Hypertarget{class_mag_graphics_view_aff7c12efbb55fcda4f29e932ff891ce0}\label{class_mag_graphics_view_aff7c12efbb55fcda4f29e932ff891ce0} 
\index{MagGraphicsView@{MagGraphicsView}!addLine@{addLine}}
\index{addLine@{addLine}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{addLine()}{addLine()}}
{\footnotesize\ttfamily void Mag\+Graphics\+View\+::add\+Line (\begin{DoxyParamCaption}\item[{QList$<$ QPointF $>$}]{Points }\end{DoxyParamCaption})}



向场景中添加线 


\begin{DoxyParams}{Parameters}
{\em Points} & 线端点坐标 \\
\hline
\end{DoxyParams}
\Hypertarget{class_mag_graphics_view_a3d0f9f9a0d29d1fe8ec9645b38f9721d}\label{class_mag_graphics_view_a3d0f9f9a0d29d1fe8ec9645b38f9721d} 
\index{MagGraphicsView@{MagGraphicsView}!addPoint@{addPoint}}
\index{addPoint@{addPoint}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{addPoint()}{addPoint()}}
{\footnotesize\ttfamily void Mag\+Graphics\+View\+::add\+Point (\begin{DoxyParamCaption}\item[{QList$<$ QPointF $>$}]{Points }\end{DoxyParamCaption})}



向场景中添加点 


\begin{DoxyParams}{Parameters}
{\em point} & 点坐标 \\
\hline
\end{DoxyParams}
\Hypertarget{class_mag_graphics_view_aa565f78d8f8e2897335665b2536032f6}\label{class_mag_graphics_view_aa565f78d8f8e2897335665b2536032f6} 
\index{MagGraphicsView@{MagGraphicsView}!addRriangle@{addRriangle}}
\index{addRriangle@{addRriangle}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{addRriangle()}{addRriangle()}}
{\footnotesize\ttfamily void Mag\+Graphics\+View\+::add\+Rriangle (\begin{DoxyParamCaption}\item[{QList$<$ QPointF $>$}]{Points }\end{DoxyParamCaption})}



向场景中添加三角形 


\begin{DoxyParams}{Parameters}
{\em Points} & 三角形三个顶点坐标 \\
\hline
\end{DoxyParams}
\Hypertarget{class_mag_graphics_view_aa8eb070a34aba2fc4de03130557f46be}\label{class_mag_graphics_view_aa8eb070a34aba2fc4de03130557f46be} 
\index{MagGraphicsView@{MagGraphicsView}!eventFilter@{eventFilter}}
\index{eventFilter@{eventFilter}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{eventFilter()}{eventFilter()}}
{\footnotesize\ttfamily bool Mag\+Graphics\+View\+::event\+Filter (\begin{DoxyParamCaption}\item[{QObject \texorpdfstring{$\ast$}{*}}]{obj,  }\item[{QEvent \texorpdfstring{$\ast$}{*}}]{event }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}}



重写事件过滤器函数 


\begin{DoxyParams}{Parameters}
{\em obj} & 事件对象 \\
\hline
\end{DoxyParams}
\Hypertarget{class_mag_graphics_view_a795ba880577b0ed3d11266f75734c73c}\label{class_mag_graphics_view_a795ba880577b0ed3d11266f75734c73c} 
\index{MagGraphicsView@{MagGraphicsView}!mouseMoveEvent@{mouseMoveEvent}}
\index{mouseMoveEvent@{mouseMoveEvent}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{mouseMoveEvent()}{mouseMoveEvent()}}
{\footnotesize\ttfamily void Mag\+Graphics\+View\+::mouse\+Move\+Event (\begin{DoxyParamCaption}\item[{QMouse\+Event \texorpdfstring{$\ast$}{*}}]{event }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}}



重写鼠标移动事件处理函数 


\begin{DoxyParams}{Parameters}
{\em event} & 事件对象 \\
\hline
\end{DoxyParams}
\Hypertarget{class_mag_graphics_view_a880c0681111672605333b1c15b567b1c}\label{class_mag_graphics_view_a880c0681111672605333b1c15b567b1c} 
\index{MagGraphicsView@{MagGraphicsView}!mousePressEvent@{mousePressEvent}}
\index{mousePressEvent@{mousePressEvent}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{mousePressEvent()}{mousePressEvent()}}
{\footnotesize\ttfamily void Mag\+Graphics\+View\+::mouse\+Press\+Event (\begin{DoxyParamCaption}\item[{QMouse\+Event \texorpdfstring{$\ast$}{*}}]{event }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}}



重写鼠标按下事件处理函数 


\begin{DoxyParams}{Parameters}
{\em event} & 事件对象 \\
\hline
\end{DoxyParams}
\Hypertarget{class_mag_graphics_view_a583b7e56e1f37c7f372a0b47a0b21ef0}\label{class_mag_graphics_view_a583b7e56e1f37c7f372a0b47a0b21ef0} 
\index{MagGraphicsView@{MagGraphicsView}!mouseReleaseEvent@{mouseReleaseEvent}}
\index{mouseReleaseEvent@{mouseReleaseEvent}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{mouseReleaseEvent()}{mouseReleaseEvent()}}
{\footnotesize\ttfamily void Mag\+Graphics\+View\+::mouse\+Release\+Event (\begin{DoxyParamCaption}\item[{QMouse\+Event \texorpdfstring{$\ast$}{*}}]{event }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}}



重写鼠标释放事件处理函数 


\begin{DoxyParams}{Parameters}
{\em event} & 事件对象 \\
\hline
\end{DoxyParams}
\Hypertarget{class_mag_graphics_view_a06c0fbf0bb356cb2fdaa7e1af0e6b025}\label{class_mag_graphics_view_a06c0fbf0bb356cb2fdaa7e1af0e6b025} 
\index{MagGraphicsView@{MagGraphicsView}!resizeGraphics@{resizeGraphics}}
\index{resizeGraphics@{resizeGraphics}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{resizeGraphics}{resizeGraphics}}
{\footnotesize\ttfamily void Mag\+Graphics\+View\+::resize\+Graphics (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_mag_graphics_view}{Mag\+Graphics\+View}} \texorpdfstring{$\ast$}{*}}]{Show\+Graphics }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [slot]}}



将显示的图形缩放到合适大小 


\begin{DoxyParams}{Parameters}
{\em Show\+Graphics} & 显示的图形对象 \\
\hline
\end{DoxyParams}
\Hypertarget{class_mag_graphics_view_a9efcab8c2747320e9c469cc77acdf11a}\label{class_mag_graphics_view_a9efcab8c2747320e9c469cc77acdf11a} 
\index{MagGraphicsView@{MagGraphicsView}!showMesh@{showMesh}}
\index{showMesh@{showMesh}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{showMesh}{showMesh}}
{\footnotesize\ttfamily void Mag\+Graphics\+View\+::show\+Mesh (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{class_g_mesh}{GMesh}} \&}]{mesh }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [slot]}}



显示网格 


\begin{DoxyParams}{Parameters}
{\em mesh} & 网格对象 \\
\hline
\end{DoxyParams}
\Hypertarget{class_mag_graphics_view_a5522102a95e0a3b8d08bc9dccce5063e}\label{class_mag_graphics_view_a5522102a95e0a3b8d08bc9dccce5063e} 
\index{MagGraphicsView@{MagGraphicsView}!wheelEvent@{wheelEvent}}
\index{wheelEvent@{wheelEvent}!MagGraphicsView@{MagGraphicsView}}
\doxysubsubsection{\texorpdfstring{wheelEvent()}{wheelEvent()}}
{\footnotesize\ttfamily void Mag\+Graphics\+View\+::wheel\+Event (\begin{DoxyParamCaption}\item[{QWheel\+Event \texorpdfstring{$\ast$}{*}}]{event }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [protected]}}



重写鼠标滚轮事件处理函数 


\begin{DoxyParams}{Parameters}
{\em event} & 事件对象 \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
magtwin/include/\mbox{\hyperlink{_mag_graphics_view_8h}{Mag\+Graphics\+View.\+h}}\item 
magtwin/Mag\+Graphics\+View.\+cpp\end{DoxyCompactItemize}
